<template>
    <div class="m-header">
        <div class="header">
            <h1 class="title">{{title}}</h1>
            <router-link tab="div" to="/search" class="search">
                <div class="search-content">
                    <span class="icon">
                        <i class="iconfont icon-search"></i>
                    </span>
                    <span class="text">搜索</span>
                </div>
            </router-link>
            <div class="logo"></div>
        </div>
    </div>
</template>

<script type="text/ecmascript-6">
    export default {
        name: 'm-header',
        props: {
            title: {
                type: String,
                default: ''
            }
        }
    }
</script>

<style scoped lang="stylus" rel="stylesheet/stylus">
    @import "~common/stylus/variable"
    @import "~common/stylus/mixin"

    .m-header
        .header
            display: flex
            padding: 20px
            line-height: 30px
            align-items: center
            .title
                font-size: $font-size-large-x
                font-weight: bold
            .search
                display: block
                flex: 1
                margin: 0 15px
                border-radius: 15px
                background: $color-background-w
                .search-content
                    margin: 0 auto
                    text-align: center
                    color: $color-text-l
            .logo
                display: block
                width: 25px
                height: 25px
                bg-image('image/logo')
                // 限制图片大小
                background-size: 25px 25px
</style>
